#!/bin/bash

# Please change path for your FileMaker version/app/runtime
#
# Please get registered Developer with Apple, get your certificate for Developer ID and put your name down here in the script.
#
# Install Xcode and run once to get command line tools.
# Drop this script file on terminal and press return to run it.

export CertificateName="Apple Development: Christian Schmitz (AC4MQK4WSK)"

ScriptFolder=$(dirname "$0")
cd "$ScriptFolder"

# remove resource fork, Finder information, or similar detritus not allowed
# do not run this script with folder in iCloud, Dropbox or similar.
xattr -cr "$ScriptFolder"

echo
echo "Signing..."
echo

codesign -f -s "$CertificateName"  Simulator/*.framework Device/*.framework

echo
echo "Check if it displays your certificate name..."
echo

codesign -d -v -v  Device/MBS.fmplugin.framework
